package com.tengfei.blogsystem.response;

/**
 * @version v1.0
 * @author} feige
 * @date 2021-10-14-16:51
 * @description
 */
public enum ResponseState {

    SUCCESS(true, 200, "操作成功"),
    ERROR(false, 100, "操作失败"),
    LOGIN_ERROR(false, 101, "登录失败"),
    LOGOUT_ERROR(false,102,"登出失败"),
    LOGIN_SUCCESS(true, 201, "登录成功"),
    LOGOUT_SUCCESS(true,202,"登出成功"),
    NOT_LOGIN(false, 102, "账号未登录"),
    NO_PERMISSION(false, 103, "无权限"),
    GET_RESOURCE_ERROR(false, 103, "获取资源失败"),
    ERROR_403(false, 403, "权限不足"),
    ERROR_404(false, 404, "页面不存在"),
    ERROR_504(false, 504, "系统繁忙，请稍后重试"),
    ERROR_505(false, 505, "请求错误");


    ResponseState() {
    }

    ResponseState(boolean success, int code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

    // 是否成功
    private boolean success;
    // 状态码
    private int code;
    // 提示消息
    private String message;

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
